//
//  UIColor+Extension.swift
//  GZWeibo666
//
//  Created by Apple on 15/12/7.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

/// 扩展UIColor
extension UIColor {
    
    /// 随机色
    class func randomColor() -> UIColor {
        return UIColor(red: randomValue(), green: randomValue(), blue: randomValue(), alpha: 1)
    }
    
    /**
    随机值(0 - 1)
    
    - returns: 随机值
    */
    private class func randomValue() -> CGFloat {
        return CGFloat(arc4random_uniform(256)) / 255
    }
}
